package com.company.bookstore.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.company.bookstore.entities.cart_module.Cart;
import com.company.bookstore.mapper.cart_module.CartMapper;
import com.company.bookstore.service.cart_module.CartService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 江洪锦
 * @since 2020-09-18
 */
@Service
public class CartServiceImpl extends ServiceImpl<CartMapper, Cart> implements CartService {

    @Resource
    CartMapper cartMapper;

    @Override
    public int getLastCartId(){
        return cartMapper.getLastCartId();
    }
//    @Override
//    public List<Cart> getCartListByUserId(int id) {
//        QueryWrapper<Cart> cartQueryWrapper = new QueryWrapper<Cart>().eq("user_id",1);
//        List<Cart> cart =list(cartQueryWrapper);
//        return cart;
//    }
}
